﻿////////////////////////////////////////////////////////////////////////
//Autor: Gabriel Tame Borao  - gabrieltame@yahoo.es 
//Fecha: 2010/09/15 01:26
//Solucion: GTameReport.sln
//Proyecto: GTameReport
//Fichero: LegendType.cs
//
//	Copyright (C) 2010  Gabriel Tame Borao (GTB)
//
//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with this program.  If not, see <http://www.gnu.org/licenses/>.
////////////////////////////////////////////////////////////////////////
namespace GTameReport
{
    using Rdl;
    using System;
    using System.Collections;

    public class LegendType
    {
        private bool? _InsidePlotArea = null;
        private LegendTypeLayout _Layout;
        private LegendTypePosition _Position;
        private GTameReport.StyleType _Style;
        private bool? _Visible = null;

        public Rdl.LegendType Write()
        {
            Rdl.LegendType type = new Rdl.LegendType();
            ArrayList list = new ArrayList();
            ArrayList list2 = new ArrayList();
            if (this._InsidePlotArea.HasValue)
            {
                list.Add(this._InsidePlotArea);
                list2.Add(ItemsChoiceType24.InsidePlotArea);
            }
            list.Add(this._Layout);
            list2.Add(ItemsChoiceType24.Layout);
            list.Add(this._Position);
            list2.Add(ItemsChoiceType24.Position);
            if (this._Style != null)
            {
                list.Add(this._Style.Write());
                list2.Add(ItemsChoiceType24.Style);
            }
            if (this._Visible.HasValue)
            {
                list.Add(this._Visible);
                list2.Add(ItemsChoiceType24.Visible);
            }
            type.Items = list.ToArray();
            type.ItemsElementName = (ItemsChoiceType24[]) list2.ToArray(typeof(ItemsChoiceType24));
            list2 = null;
            list = null;
            return type;
        }

        public bool? InsidePlotArea
        {
            get
            {
                return this._InsidePlotArea;
            }
            set
            {
                this._InsidePlotArea = value;
            }
        }

        public LegendTypeLayout Layout
        {
            get
            {
                return this._Layout;
            }
            set
            {
                this._Layout = value;
            }
        }

        public LegendTypePosition Position
        {
            get
            {
                return this._Position;
            }
            set
            {
                this._Position = value;
            }
        }

        public GTameReport.StyleType Style
        {
            get
            {
                if (this._Style == null)
                {
                    this._Style = new GTameReport.StyleType();
                }
                return this._Style;
            }
            set
            {
                this._Style = value;
            }
        }

        public bool? Visible
        {
            get
            {
                return this._Visible;
            }
            set
            {
                this._Visible = value;
            }
        }
    }
}

